﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;



namespace ISFProject.Models
{
    public class Advertisement
    {
        [Key]
        public int Id { get; set; }
        [Required(ErrorMessage = "Ad name is missing")]
        [StringLength(45, MinimumLength = 3, ErrorMessage = "Invalid fieldlength")]
        public string Name { get; set; }
        [Required(ErrorMessage = "Please select a typeOfadvert")]
        public SportCategory TypeOfAdvert { get; set; }
         [Required(ErrorMessage = "Please select a StartDate")]
        [Range(typeof(DateTime), "1/2/2013", "3/4/2020",
        ErrorMessage = "Value for {0} must be between {1} and {2}")]
        public DateTime StartDate { get; set; }
         [Required(ErrorMessage = "Please select a EndDate")]
         [Range(typeof(DateTime), "1/2/2013", "3/4/2020",
         ErrorMessage = "Value for {0} must be between {1} and {2}")]
        public DateTime EndDate { get; set; }


        public virtual List<Country> Countries { get; set; }


    }
}